Statistic Assignment 1¶

Q1. Plot a histogram, 10, 13, 18, 22, 27, 32, 38, 40, 45, 51, 56, 57, 88, 90, 92, 94, 99

In [1]:
import plotly.express as px
import numpy as np
In [2]:
x = [10, 13, 18, 22, 27, 32, 38, 40, 45, 51, 56, 57, 88, 90, 92, 94, 99]
fig = px.histogram(x= x,nbins=10)
fig.show()

Q2 In a quant test of the CAT Exam, the population standard deviation is known to be 100. A sample of 25 tests taken has a mean of 520. Construct an 80% CI about the mean.

In [3]:
sd = 100 #population standard deviation
n = 25   #sample size
x = 520  #sample mean
a = 0.2  #alpha
z = 1.28

lower_limit = x - z*(sd/np.sqrt(n))
print("lower limit= ",lower_limit)

upper_limit = x + z*(sd/np.sqrt(n))
print("upper limit= ",upper_limit)

print("the 80% CI about mean is: {0} to {1}".format(lower_limit,upper_limit))
lower limit=  494.4
upper limit=  545.6
the 80% CI about mean is: 494.4 to 545.6

Q3. A car believes that the percentage of citizens in city ABC that owns a vehicle is 60% or less. A sales manager disagrees with this. He conducted a hypothesis testing surveying 250 residents & found that 170 residents responded yes to owning a vehicle.

  1. State the null & alternate hypothesis.
  2. At a 10% significance level, is there enough evidence to support the idea that vehicle owner in ABC city is 60% or less.
  1. Ho is mean(u)] <= 0.6 (one tailed), H1 is mean(u)>0.6
  2. alpha is 10% significance level (0.1) 90% CI p1 = 0.68 po = 0.6 n = 250 Zo = (p1 - po)/sqrt(po(1-po)/n) if Zo<1.28 reject Ho
In [4]:
P = 0.68
Po = 0.6
n = 250
Zo = (P-Po)/np.sqrt(Po*(1-Po)/n)
print("Zo= {0}".format(Zo))
if Zo < 1.28:
    print("We accept null hypothesis that % of citizens in city ABC that owns vehicle is 60% or less")
else:
    print("We reject null hypothesis that % of citizens in city ABC that owns vehicle is more than 60%")
Zo= 2.5819888974716134
We reject null hypothesis that % of citizens in city ABC that owns vehicle is more than 60%

Q4. What is the value of the 99 percentile? 2,2,3,4,5,5,5,6,7,8,8,8,8,8,9,9,10,11,11,12

In [5]:
x = [2,2,3,4,5,5,5,6,7,8,8,8,8,8,9,9,10,11,11,12]
P = 99
percentile = np.percentile(x,99)
percentile
Out[5]:
11.809999999999999

Q5. In left & right-skewed data, what is the relationship between mean, median & mode? Draw the graph to represent the same.

1_XU3Kdl521XnWHECHZ7XOaQ.jpeg

  1. In Right skewed distribution: Mode < Median < Mean
  2. In Left skewed distribution: Mean < Median < Mode